home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / utility / dirco707.zip / BRUCEINI.DOC < prev    next >
Text File  |  1997-07-31  |  13KB  |  304 lines

  1. BRUCEINI.DOC                           1                           Jul 31, 1997
  2.  
  3. This text file describes using an *.INI  file  or  environmental  variables  to
  4. override the system defaults for this and other programs by  the  same  author.
  5. Both of these are always optional but they can be very useful.
  6.  
  7. - - - - - - - - - - - - - - - - -  INI files  - - - - - - - - - - - - - - - - -
  8.  
  9. 1.1 What is an INI file?
  10.  
  11.      An INI file is a way of specifying parameters for a program that you don't
  12.      want to have to respecify from the command line each  time.   This  allows
  13.      you to override any program defaults you want to change.
  14.  
  15.      This is very useful if you disagree with the defaults I've established for
  16.      the routines.  It is also useful in cases  where  you  typically  use  the
  17.      command one way but in fairly regular cases you need to  run  the  command
  18.      using a whole bunch of different parameters.  You can set up one INI  file
  19.      for your standard usage and then provide a different INI  file  when  it's
  20.      time to run the lesser used versions.
  21.  
  22. 1.2 What's the default INI file name for each program?
  23.  
  24.      Each of the programs reads an INI file if it can find  one.   By  default,
  25.      the INI file that is searched for is based on the  executable's  name  but
  26.      not always. This is shown  below  (block  declarations  are  described  in
  27.      1.3(c) below; environmental variables are described in section 2.1 below):
  28.  
  29.              Routine         INI file        Block           Environmental
  30.                                                              Variable
  31.  
  32.              AV.EXE          AV.INI          [AV]            AV
  33.              BFIND.EXE       BFIND.INI       [BFIND]         BFIND
  34.              CHANGE.EXE      CHANGE.INI      [CHANGE]        CHANGE
  35.              CONVERT.EXE     CONVERT.INI     [CONVERT]       CONVERT
  36.              COPSINCE.EXE    COPSINCE.INI    [COPSINCE]      COPSINCE
  37.              DATES.EXE       DATES.INI       [DATES]         DATES
  38.              DIRCOMP.EXE     DIRCOMP.INI     [DIRCOMP]       DIRCOMP
  39.              DIRTOTAL.EXE    DIRTOTAL.INI    [DIRTOTAL]      DIRTOTAL
  40.              EUMAIL.EXE      EUMAIL.INI      [EUMAIL]        EUMAIL
  41.              FILL.EXE        FILL.INI        [FILL]          FILL
  42.              FILUPDAT.EXE    FILUPDAT.INI    [FILUPDAT]      FILUPDAT
  43.              FIXTEXT.EXE     FIXTEXT.INI     [FIXTEXT]       FIXTEXT
  44.              FORTUNE.EXE     FORTUNE.INI     [FORTUNE]       FORTUNE
  45.              HTMSTRIP.EXE    HTMSTRIP.INI    [HTMSTRIP]      HTMSTRIP
  46.              ISAMFIND.EXE &
  47.                ISAMMAKE.EXE  ISAMFIND.INI    [ISAMFIND]      ISAMFIND
  48.              MOZ.EXE         MOZ.INI         [MOZ]           MOZ
  49.              PAGINATE.EXE    PAGINATE.INI    [PAGINATE]      PAGINATE
  50.              READ.EXE &
  51.                READINIT.EXE &
  52.                READMAKE.EXE &
  53.                READY.EXE     READ.INI        [READ]          READ
  54.              TXTABLE.EXE     TXTABLE.INI     [TXTABLE]       TXTABLE
  55.  
  56.  
  57. BRUCEINI.DOC                           2                           Jul 31, 1997
  58.  
  59. 1.3 What does an INI file look like?
  60.  
  61.      The INI file is an ASCII text file that can be created maintained by hand.
  62.      The commands in the INI file should begin in column 1.  It can consist of:
  63.  
  64.      (a) Command-line parameters
  65.      (b) Comments
  66.      (c) Block declarations
  67.      (d) Special items (vary by routine)
  68.  
  69.      (a)  Command-line parameters:  The INI file can consist  or  one  or  more
  70.           command line parameters.   In  most  cases,  it  can  *only*  include
  71.           command line parameters that begin with a slash  ("/").   These  will
  72.           vary by routine of course but, in READ for  example,  your  INI  file
  73.           might appear like this:
  74.  
  75.         /MONO
  76.         /-DOS
  77.         /COLOR=123 134 145 156
  78.  
  79.      (b)  Comments:  The INI file can also contain comment  lines.   These  are
  80.           defined as any lines that are blank or begin with a semi-colon.
  81.  
  82.      Comments can also begin after a statement.  Precede them with at least two
  83.           spaces and a semi-color or one  or  more  space  and  "/*"  like  the
  84.           following:
  85.  
  86.         /MONO   ; Need to override color setting since upsets monitor
  87.         /-DOS   /* Don't want them being able to jump to DOS
  88.  
  89.      (c)  Block declarations:  You can combine INI files if you'd  like.   This
  90.           saves some disk space.  Typically, this is done  in  connection  with
  91.           the SET BG=inifile environmental parameter (described below).  Blocks
  92.           are declared by using the name of searched-for routine  in  brackets.
  93.           (See the table above to see what blocks are  searched  for  for  each
  94.           routine.) Any statements between one block and the next  are  assumed
  95.           to be associated with the first routine.  For example:
  96.  
  97.              ; ALL.INI -- contains all of the INI statements
  98.              [DATES]
  99.              /SORT
  100.              [FILL]
  101.              /ON
  102.              /SPLIT
  103.              [READ]
  104.              /MONO
  105.  
  106.  
  107. BRUCEINI.DOC                           3                           Jul 31, 1997
  108.  
  109.      (d)  Special  items:   Some  routines  allow  the  INI  file  to   include
  110.           statements that cannot be specified from  the  command  line.   These
  111.           special  statements  are  described   in   the   specific   routine's
  112.           documentation.
  113.  
  114.      A fairly complicated example might be an INI file used  for  the  HTMSTRIP
  115.      program.  In this case, you might find  all  of  the  following  types  of
  116.      lines:
  117.  
  118.              (blank line)   ignored as comment
  119.              ;xxxxx         ignored as comment
  120.              [xxxxx]        beginning of program block (e.g. "[HTMSTRIP]")
  121.              /xxxxx         command-line parameters
  122.              \xxx = \xxx    character-translation entry
  123.              &xxx;= xxx     entity references (HTML translations)
  124.              <xxx> = xxx    how to show certain blocks
  125.  
  126. 1.4 Where does each program look for the INI file?
  127.  
  128.      Each program here looks for an INI file unless instructed otherwise.   The
  129.      logic used is as follows.  Note that the first "hit" wins:
  130.  
  131.      (a)  No INI file is checked for if any of the following is true:
  132.  
  133.              - /-I or /INULL is passed in from the command line
  134.              - /-I or /INULL is passed  in  from  the  routine's  environmental
  135.                parameter (for example, SET READ=/-I)
  136.              - the environmental variable BG is set to  the  value  of  /-I  or
  137.                /INULL (for example, SET BG=/-I)
  138.  
  139.           Most programs accept either /-I or /INULL.  However, several routines
  140.           (BFIND and CHANGE) accept /-I to mean do a  case-insensitive  search.
  141.           For these programs, you *have* to use /INULL instead.
  142.  
  143.      (b)  If a /Iinitfile setting is  passed  in,  the  routine  uses  this  to
  144.           determine the name of the INI file to look for.  Note that  the  file
  145.           name must include a  period  (for  example,  "/ICHANGE.INI")  or  the
  146.           program will skip it.
  147.  
  148.      (c)  The routine looks for an environmental variable BG.  If this variable
  149.           is defined (and it's not set to /-I), then the routine takes this  to
  150.           be the name of the INI file to look for.
  151.  
  152.      (d)  The routine looks for the INI file under the "INI file" name shown in
  153.           the table at the start of this documentation.
  154.  
  155.  
  156. BRUCEINI.DOC                           4                           Jul 31, 1997
  157.  
  158. 1.5 What's the search path sequence for the INI file?
  159.  
  160.      If the INI file name does not include either a drive or path specification
  161.      (for example, you don't pass in something like /IC:\ALL.INI), the  routine
  162.      will search for the named file.  It will check for  it  in  the  following
  163.      places in the following order.  The first place that it finds it wins:
  164.  
  165.         - Your default subdirectory (where  you  were  when  you  executed  the
  166.           command)
  167.         - The subdirectory that contains the EXE that you're executing
  168.         - Your regular DOS path
  169.  
  170.      If you do not have an INI file, this searching can take awhile  especially
  171.      if you have any networked drives in your path.  In this  case,  specifying
  172.      "/-I" will save some time.  Passing in a  fully  qualified  filename  also
  173.      helps.
  174.  
  175. 1.6 I'm lost.  What does your INI file look like?
  176.  
  177.      Personally, I have a common INI file named WAYNE.INI in the root of my  C:
  178.      drive.  I put it there so I  don't  run  out  of  environmental  space  by
  179.      specifying  some  huge  path.   I  have  the  following  statement  in  my
  180.      AUTOEXEC.BAT:
  181.  
  182.           SET BG=C:\WAYNE.INI
  183.  
  184.      Currently, my C:\WAYNE.INI file looks like this:
  185.  
  186.           [AV]
  187.           /on
  188.           [bfind]
  189.           /-empty
  190.           [COPSINCE]
  191.           /def text=*.bas *.bi *.c *.diz *.doc *.h *.ref *.sas *.sc *.txt
  192.           /def prg=*.bas *.bat *.bi *.c *.h *.sas
  193.           /to c:\temp
  194.           /replace
  195.           /text
  196.           /copy -0
  197.           [DATES]
  198.           /cc:\mine\datemine.txt
  199.           /sort
  200.           /day
  201.           /-i
  202.           [FILL]
  203.           /letter
  204.           [htmstrip]
  205.           /lc:\vbdos\htmstrip.ini
  206.           /-symbols
  207.           /warnings
  208.           [paginate]
  209.           /overwrite
  210.           /cc:\bat\brucedoc.ctl
  211.  
  212.      If I ever need to override the WAYNE.INI settings,  it's  easy  to  do  by
  213.      passing them in from the command  line  or  by  specifying  /-I  from  the
  214.      command line.
  215.  
  216.  
  217. BRUCEINI.DOC                           5                           Jul 31, 1997
  218.  
  219. - - - - - - - - - - - -  Using Environmental variables  - - - - - - - - - - - -
  220.  
  221. 2.1 Introduction
  222.  
  223.      The programs all allow you to pass in regular DOS environmental variables,
  224.      either from the command line or from the INI file.  These  variables  will
  225.      be resolved by the program.  Under Windows 95 and 4DOS, the variables  are
  226.      resolved by the operating system instead.
  227.  
  228. 2.2 What are environmental variables?
  229.  
  230.      The DOS environment is a shared area of memory that is  used  for  setting
  231.      certain values that one or more program  might  need.   These  values  are
  232.      retrieved by examining a given environmental variable which  has  specific
  233.      information that a program might want.
  234.  
  235.      To see you environmental variables, type "SET" from  the  DOS  prompt  and
  236.      press <ENTER>.  This will return a listing of the environmental  variables
  237.      and their values.  For example:
  238.  
  239.         C:\>SET<ENTER>
  240.         CONFIG=NORMAL
  241.         BG=C:\WAYNE.INI
  242.         BLASTER=A220 I5 D1 H5 P320 Q2 T4
  243.         COMSPEC=C:\COMMAND.COM
  244.         CPAV=D:\PCT\DATA\CPAV.INI
  245.         CPBACKUP=D:\PCT\DATA
  246.         LINK=/SE:256
  247.         PATH=C:\DOS;C:\BAT;C:\;C:\UTIL;C:\UTIL\COPY;C:\UTIL\80386;C:\VBDOS;C:\UTIL\GRAPHICS;D:\PCT;E:\WINDOWS
  248.         PCTOOLS=D:\PCT\DATA
  249.         PROMPT=$p$g
  250.         TEMP=E:\TEMP
  251.         C:\>
  252.  
  253.      Environmental variables can be set by saying "SET variable=value" such as:
  254.  
  255.         SET PROMPT=$p$g
  256.  
  257.  
  258. 2.3 Aren't there special environmental variables for these routines?
  259.  
  260.      (a)  Each routine has a default environmental  variable  that  is  checked
  261.           when the program runs.  See the table in section 1.2 above  for  more
  262.           information about this.
  263.      (b)  Each routine also checks an environmental variable BG for it's value.
  264.  
  265.  
  266. BRUCEINI.DOC                           6                           Jul 31, 1997
  267.  
  268. 2.4 Other than the special ones above,  how  would  you  use  an  environmental
  269. variable in these routines?
  270.  
  271.      Pass in the variable as "%variable%" as part of the regular parameter list
  272.      (or in the INI file  or  whatever)  and  the  programs  will  resolve  the
  273.      variable to its assigned value for you.  For example:
  274.  
  275.              C:\>SET USER=BGuthrie
  276.              C:\>BFIND %USER% SYSTEM.INI
  277.  
  278.      Will cause the BFIND program to search for the string "BGuthrie"  when  it
  279.      is run.  The routine leaves intact any variables that are not defined.
  280.  
  281.      If you wish to turn off resolution of the environmental variables, pass in
  282.      the parameter /-ENV.
  283.  
  284. 2.5 Can I assign something with an equal sign in the value?
  285.  
  286.      Environmental variables can't contain equal signs since these are used for
  287.      the assignment itself.  If you need to use an equal sign, put a  comma  in
  288.      instead and my programs will translate it as an equal sign for you.   This
  289.      will not affect  any  comma  within  a  quoted  string.   Note  that  this
  290.      convention is not standard within DOS so it's only going to work in  these
  291.      specific programs.
  292.  
  293. - - - - - - - - - - - - - - - - - - Author - - - - - - - - - - - - - - - - - -
  294.  
  295.                 Bruce Guthrie
  296.                 Wayne Software
  297.                 113 Sheffield St.
  298.                 Silver Spring, MD 20910
  299.  
  300.                 e-mail: WayneSof@erols.com   fax: (301) 588-8986
  301.                 http://www.geocities.com/SiliconValley/Lakes/2414
  302.  
  303. 
  304.